=<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>欢迎光临 Music Store</title>
	<link type="text/css" rel="Stylesheet" href="${pageContext.request.contextPath }/style/front.css"/>
 	<script src="${pageContext.request.contextPath}/script/jquery-1.10.2.js"></script>
 	<script>
 		$(function(){
 			/* $("#button").click(function(){
  				location.href="addCart?albumId="+$("#albumId").val();
 			}); */
 			$("#button").click(function(){
 				$.ajax({
					type : "GET",
					data : "albumId="
							+ $("#albumId").val(),
					url : "addCart",
					dataType : "json",
					success : function() {
						alert("添加成功");
					}
				});
 			});
 		});
 	</script>
 	<style>
 		dt{float:left;padding-right: 20px;}
 		dd{padding:10px;}
 		dd td{padding:0px 0px 10px 10px;}
 		.details{clear:both;}
 		.description{width:100px;}
 	</style>
  </head>
  <body>
    <div id="wrapper">
		<s:action name="header" namespace="/" executeResult="true"/>
    	<div id="content">
    		<s:action name="sidebar" executeResult="true" namespace="/"></s:action>
    		<div id="main">
				<h3 id="main-title">唱片详细资料</h3>
				<dl>
					<dt><img src="CoverImages/${album.id }.jpg" /></dt>
					<dd>
						<table class="album">
						<tr>
							<td><strong>专辑名称：</strong></td>
							<td>${album.title }</td>
						</tr>
						<tr>
							<td><strong>歌手：</strong></td>
							<td>${album.artist }</td>
						</tr>
						<tr>
							<td><strong>定价：</strong></td>
							<td>${album.price }</td>
						</tr>
						<tr>
							<td><strong>发行时间：</strong></td>
							<td>${album.dateReleased }</td>
						</tr>
						<tr>
							<td><input type="hidden" value="${album.id }" id="albumId"/></td>
							<td><input type="button" value="购买" id="button"/> </td>
						</tr>
						</table>
					</dd>
				</dl>
				<table class="details">
				<tr>
					<td class="description"><strong>详细介绍：</strong></td>
					<td>${album.description }</td>
				</tr>
				</table>
    		<div class="clearBoth"></div>
    	</div>
    	<%@ include file="../shared/footer.jsp" %>
    </div>
  </body>
</html>
